﻿using D.B.Data.WebAPI.Applications;
using D.B.Data.Domain;
using D.B.Data.ErrorCode;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace D.B.Data.WebAPI.Controllers
{
    /// <summary>
    /// 12222222222
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ManagementController : ControllerBase
    {
        private readonly IServices services;

        public ManagementController(IServices services)
        {
            this.services = services;
        }

        [HttpGet]
        public APIResult<List<AccountModel>> GetAccount()
        {
          return services.GetAccount();
        }

        [HttpPost]
        public APIResult<int> UpdateState(int Id, int State)
        {
            return services.UpdateState(Id, State);
        }
    }
}
